* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --global-font: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --time-color: #ffffff;
    --date-color: rgba(255, 255, 255, 0.8);
    --text-color: rgba(255, 255, 255, 0.85);
}

body {
    background-color: #000;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    transition: background-image 1.5s ease-in-out;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: var(--global-font);
}

#background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.9));
    z-index: -1;
}

.container {
    max-width: 1200px;
    width: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.5s ease;
    height: 100vh;
    justify-content: center;
}

/* 顶部控制按钮 */
.controls {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 100;
}

.btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.btn i {
    font-size: 18px;
}

/* 中央区域 */
.center-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    width: 100%;
    transition: all 0.3s ease;
}

.time-date-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.time-display {
    font-size: 8vw;
    font-weight: 300;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    margin-bottom: 10px;
    transition: all 0.5s ease;
    color: var(--time-color);
}

.date-display {
    font-size: 2.5vw;
    font-weight: 300;
    margin-bottom: 30px;
    transition: all 0.5s ease;
    color: var(--date-color);
}

/* 随机文字区域 */
.random-text-container {
    max-width: 90%;
    margin: 0 auto;
    text-align: center;
    min-height: 80px;
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.random-text {
    font-size: 1.8rem;
    font-weight: 300;
    transition: all 0.5s ease;
    max-width: 95%;
    word-wrap: break-word;
    line-height: 1.5;
    padding: 15px 25px;
    border-radius: 15px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-color);
}

/* 内容区域 - 可滚动 */
.content-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-height: 50vh;
    overflow-y: auto;
    transition: all 0.5s ease;
    padding: 20px 0;
    opacity: 1;
    transform: translateY(0);
    margin-top: 5vh;
}

.content-container.hidden {
    opacity: 0;
    transform: translateY(20px);
    max-height: 0;
    padding: 0;
    overflow: hidden;
    margin-top: 0;
}

/* 搜索区域 */
.search-container {
    max-width: 600px;
    width: 100%;
    margin: 0 auto 40px;
    position: relative;
    transition: all 0.5s ease;
}

.search-box {
    width: 100%;
    padding: 15px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: var(--global-font);
}

.search-box:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

/* 快捷链接区域 */
.quick-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    max-height: 35vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    transition: all 0.5s ease;
}

.quick-links::-webkit-scrollbar {
    width: 8px;
}

.quick-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.link-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    flex: 0 0 calc(20% - 20px);
    min-width: 100px;
    max-width: 120px;
    color: var(--text-color);
    font-family: var(--global-font);
}

.link-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.link-item .icon-container {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.link-item .icon-container i {
    font-size: 24px;
}

.link-item .icon-container img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 50%;
}

.link-item span {
    font-size: 0.9rem;
}

.delete-link {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: rgba(255, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.link-item:hover .delete-link {
    opacity: 1;
}

.edit-link {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 20px;
    height: 20px;
    background: rgba(0, 123, 255, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}

.link-item:hover .edit-link {
    opacity: 1;
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(30, 30, 40, 0.95);
    backdrop-filter: blur(20px);
    padding: 30px;
    z-index: 200;
    overflow-y: auto;
    transition: right 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.5);
    font-family: var(--global-font);
}

.settings-panel.open {
    right: 0;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h2 {
    font-weight: 400;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.settings-group {
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.settings-group h3 {
    font-weight: 400;
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.settings-group h3 i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.color-picker {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.color-option {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-option.active {
    border-color: white;
    transform: scale(1.1);
}

.font-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.font-option {
    padding: 8px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.font-option.active {
    background: rgba(255, 255, 255, 0.3);
}

.animation-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.animation-option {
    padding: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.animation-option.active {
    background: rgba(255, 255, 255, 0.3);
}

.slider-container {
    margin: 15px 0;
}

.slider-container label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

input[type="range"] {
    width: 100%;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-family: var(--global-font);
}

.form-control:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
}

.btn-primary {
    background: #4a6cf7;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
    font-weight: 500;
    font-family: var(--global-font);
}

.btn-primary:hover {
    background: #3a5ce0;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #ff4757;
}

.btn-success {
    background: #2ed573;
}

.custom-items-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
}

.custom-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: var(--global-font);
}

.custom-item:last-child {
    margin-bottom: 0;
}

.custom-item .actions {
    display: flex;
    gap: 5px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-family: var(--global-font);
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.fade-in {
    animation: fadeIn 1.5s ease-in-out forwards;
}

.slide-up {
    animation: slideUp 1s ease-out forwards;
}

.typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation:
        typewriter 4s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: #fff;
    }
}

.fade-out {
    animation: fadeIn 1.5s ease-in-out reverse forwards;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .time-display {
        font-size: 12vw;
    }

    .date-display {
        font-size: 4vw;
    }

    .random-text {
        font-size: 1.4rem;
    }

    .settings-panel {
        width: 100%;
        right: -100%;
    }

    .quick-links {
        grid-template-columns: repeat(3, 1fr);
    }

    .link-item {
        flex: 0 0 calc(33% - 20px);
    }
}

/* 状态提示 */
.status-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    z-index: 1000;
    animation: fadeIn 0.5s ease-in-out;
    display: none;
    font-family: var(--global-font);
}

/* 背景加载指示器 */
.bg-loader {
    position: fixed;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    z-index: 1000;
    display: none;
    font-family: var(--global-font);
}

/* 编辑模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 300;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: rgba(40, 40, 50, 0.95);
    border-radius: 15px;
    padding: 25px;
    width: 90%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    font-family: var(--global-font);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-title {
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 显示控制按钮 */
.visibility-control {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
}

.visibility-control:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
}

.toggle-btn.active {
    background: #4a6cf7;
}

.toggle-btn::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: all 0.3s ease;
    left: 2px;
}

.toggle-btn.active::before {
    left: calc(100% - 18px);
}

/* 文本隐藏时的布局 */
.text-hidden .center-container {
    justify-content: center;
}

.text-hidden .time-date-container {
    margin-bottom: 0;
}

.text-hidden .random-text-container {
    display: none;
}